import { reactive } from 'vue';

function useAddStudent(state) {
    let state2 = reactive({
        stus: {
            id: '',
            name: '',
            thing: '',
        }
    });

    function addSub(e) {
        e.preventDefault();
        let list = Object.assign({}, state2.stus);
        state.stus.push(list);
        state2.stus.id = '';
        state2.stus.name = '';
        state2.stus.thing = '';
    }
    return { state2, addSub }
}

export default useAddStudent;